package com.moss.cloud.common.security.event;

import lombok.SneakyThrows;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class AbstractEventListener implements ApplicationListener<AbstractEvent> {

    /**
     * 异步执行方法
     *
     * @param event
     */
    @Override
    @SneakyThrows
    @Async("asyncServiceExecutor")
    public void onApplicationEvent(AbstractEvent event) {
        event.execute();
    }
}
